xend: Fix VDI-VBD link for XenAPI
I detected problems of VDI-VBD link again.
- In the case of inactive managed domains, VDI->VBD link was lost
by xend restarting (or host OS rebooting).
- In the case of active domains, both VDI->VBD link and VBD->VDI
link were lost by xend restarting.
When xend is restarted, information of VDI instances is restored from
a vdi.xml file. But the vdi.xml file does not have UUID of VBD
because xend does not write the UUID to the vdi.xml file. Therefore,
VDI->VBD link is lost. When xend is restarted, information of VBD
instances is restored from xenstore. But xenstore does not have UUID
of VDI. Therefore, VBD->VDI link is lost.
This patch solves the problems. VDI instances stop having UUID of
VBD. Instead, xend gathers UUID of VBD each time it's required. The
method is the same as Network->VIF link. Information of VBD instances
is restored not only from xenstore but from a config.sxp file. UUID
of VDI is restored from the config.sxp file.
FYI, VBD->VDI link of inactive managed domains is not lost because
information of VBD instances is restored from the config.sxp file.
UUID of VDI is written by xend to the config.sxp file.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>